package com.mxf.code.util;

import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.Date;

public class DateUtils {
    private static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
    private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern(DATE_FORMAT);

    public static String toIso8601(Date date) {
        return FORMATTER.format(date.toInstant().atZone(ZoneId.systemDefault()));
    }
}
